home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: New Zealand Amiga Users Group / New Zealand Amiga Users Group Newsdisk v25 (1989-08)(NZAmigaUG).zip / New Zealand Amiga Users Group Newsdisk v25 (1989-08)(NZAmigaUG).adf / StrucBrowser / sb.src.zoo / sbgfxbase.c < prev    next >
C/C++ Source or Header  |  1988-06-22  |  7KB  |  199 lines

  1. /************************************************************************
  2. *                                    *
  3. *                SBGfxBase                *
  4. *                                    *
  5. *    by David Annett, 3 Sutherland Ave, Upper Hutt, New Zealand    *
  6. *                                    *
  7. *                17 July 89                *
  8. *                                    *
  9. *************************************************************************/
  10.  
  11. #include "sb.h"
  12. extern int level;
  13. extern struct GfxBase *GfxBase;
  14. extern void PrGfxBase2();
  15. extern void PrGfxBase3();
  16. extern void PrGfxBase4();
  17.  
  18. void PrGfxBase(string, GBase) char *string; struct GfxBase *GBase;
  19. {
  20. static struct StructData structdata[] = {
  21.      { " LibNode",      "struct Library",      0, SZ(Library)    },
  22.      { " ActiView",    "struct View *",       5, PTRSIZE    },
  23.      { "(copinit",      "struct copinit *)",   5, PTRSIZE    },
  24.      { "(cia",          "LONG)",               5, PTRSIZE    },
  25.      { "(blitter",      "LONG)",               5, PTRSIZE    },
  26.      { "-LOFlist",      "UWORD *"  ,           5, PTRSIZE    },
  27.      { "-SHFlist",      "UWORD *",             5, PTRSIZE    },
  28.      { "(blthd",        "struct bltnode *)",   5, PTRSIZE    },
  29.      { "(blttl",        "struct bltnode *)",   5, PTRSIZE    },
  30.      { "(bsblthd",      "struct bltnode *)",   5, PTRSIZE    },
  31.      { "(bsblttl",      "struct bltnode *)",   5, PTRSIZE    },
  32.      { "(vbsrv",    "Interrupt)",           0, SZ(Interrupt) },
  33.      { "(timsrv",    "Interrupt)",           0, SZ(Interrupt) },
  34.      { "(bltsrv",    "Interrupt)",           0, SZ(Interrupt) },
  35.      { " TextFonts",    "struct List",         0, SZ(List)    },
  36.      { "(DefaultFont",  "struct TextFont *)",  5, PTRSIZE    }
  37.   };
  38. int sum, choice = -1;
  39.   level++;
  40.   while (choice) {
  41.     sum = SetOptionText(string, structdata, (APTR)GBase, DATASIZE, 0);
  42.     switch (choice = GetChoice(MAXGADG + 1)) {
  43.       case        1:
  44.       PrLibrary ("Graphics base library node", &GBase->LibNode);
  45.     break;
  46.       case        2:
  47.     if (GBase->ActiView)
  48.       PrView ("The currently active view", GBase->ActiView);
  49.     break;
  50.       case       15:
  51.       PrList ("TextFonts List structure", &GBase->TextFonts);
  52.     break;
  53.       case MOREGADG:
  54.     PrGfxBase2(" GfxBase (page 2)", GBase, sum);
  55.         break;
  56.     }
  57.   }
  58.   level--;
  59. }
  60.  
  61. void PrGfxBase2(string, GBase, offset) char *string; struct GfxBase *GBase;
  62. int offset;
  63. {
  64. static struct StructData structdata[] = {
  65.      { " Modes",        "UWORD",              12, INTSIZE    },
  66.      { "-VBlank",       "BYTE",                3, BYTESIZE    },
  67.      { "-Debug",        "BYTE",                3, BYTESIZE    },
  68.      { "-BeamSync",     "SHORT",               2, INTSIZE    },
  69.      { " sys_bplcon0",  "SHORT",               2, INTSIZE    },
  70.      { "-SpriteRes",    "UBYTE",               3, BYTESIZE    },
  71.      { "-byteres",      "UBYTE",               3, BYTESIZE    },
  72.      { "-Flags",        "USHORT",             12, INTSIZE    },
  73.      { "-BlitLock",    "SHORT",           2, INTSIZE    },
  74.      { "-BlitNest",    "SHORT",           2, INTSIZE    },
  75.      { " BlitWaitQ",    "struct List",         0, SZ(List)    },
  76.      { "(BlitOwner",    "struct Task *)",      5, PTRSIZE    },
  77.      { " TOF_WaitQ",    "struct List",         0, SZ(List)    },
  78.      { " DisplayFlags", "UWORD",           2, INTSIZE    },
  79.      { "(SimpleSprite", "struct SmSprite **)", 5, PTRSIZE    },
  80.      { "-MaxDspRow",    "UWORD",           2, INTSIZE    }
  81.   };
  82. static char *flagnames[16] = {
  83.     NULL,        "ERSY",        "LACE",        "LPEN",
  84.     NULL,        NULL,        NULL,        NULL,
  85.     "GAUD",        "COLOR",    "DBLPF",    "HOMOD",
  86.     "BPU0",        "BPU1",        "BPU2",        "HIRES"
  87.   };
  88. static char *Dflgnames[16] = {
  89.     "NTSC",        "GENLOC",        "PAL"
  90.   };
  91. int sum, choice = -1;
  92. UWORD bits;
  93.   level++;
  94.   while (choice) {
  95.     sum = SetOptionText(string, structdata, (APTR)GBase, DATASIZE, offset);
  96.     switch (choice = GetChoice(MAXGADG + 1)) {
  97.       case  1:
  98.     bits = GfxBase->Modes;
  99.     FlagPrint("Display mode first blpcom0",flagnames,(ULONG)bits);
  100.         break;
  101.       case  5:
  102.     bits = GfxBase->system_bplcon0;
  103.     FlagPrint("'or'ed into each blpcon0 for display",flagnames,(ULONG)bits);
  104.         break;
  105.       case 11:
  106.       PrList ("BlitWaitQ List structure", &GBase->BlitWaitQ);
  107.     break;
  108.       case 13:
  109.       PrList ("TOF_WaitQ List structure", &GBase->TOF_WaitQ);
  110.     break;
  111.       case 14:
  112.     bits = GfxBase->DisplayFlags;
  113.     FlagPrint("Display Flags",Dflgnames,(ULONG)bits);
  114.         break;
  115.       case MOREGADG:
  116.     PrGfxBase3(" GfxBase (page 3)", GBase, sum);
  117.         break;
  118.     }
  119.   }
  120.   level--;
  121. }
  122.  
  123. void PrGfxBase3(string, GBase, offset) char *string; struct GfxBase *GBase;
  124. int offset;
  125. {
  126. static struct StructData structdata[] = {
  127.      { "-MaxDspColumn",    "UWORD",          12, INTSIZE    },
  128.      { "-NorDspRow",    "UWORD",          12, INTSIZE    },
  129.      { "-NorDspColumn",    "UWORD",          12, INTSIZE    },
  130.      { "-NormalDPMX",    "UWORD",          12, INTSIZE    },
  131.      { "-NormalDPMY",    "UWORD",          12, INTSIZE    },
  132.      { "(LastChanceMem","struct SigSemaph *)", 5, PTRSIZE    },
  133.      { "-LCMptr",    "UWORD *",           5, PTRSIZE    },
  134.      { "-MicrosPerLine","UWORD",          12, INTSIZE    },
  135.      { "-MinDisplayCol","UWORD",          12, INTSIZE    },
  136.      { " reserved[2]",    "ULONG",           0, PTRSIZE * 2    },
  137.      { " hedley[4]",    "ULONG",           0, PTRSIZE * 4    },
  138.      { " hedley2[4]",    "ULONG",           0, PTRSIZE * 4    },
  139.      { "-hedley_count", "SHORT",           2, INTSIZE    },
  140.      { "-hedley_flags", "USHORT",           2, INTSIZE    },
  141.      { "-hedley_count1","SHORT",           2, INTSIZE    },
  142.      { "-hedley_tmp",    "SHORT",           2, INTSIZE    }
  143.   };
  144. int sum, choice = -1;
  145.   level++;
  146.   while (choice) {
  147.     sum = SetOptionText(string, structdata, (APTR)GBase, DATASIZE, offset);
  148.     switch (choice = GetChoice(MAXGADG + 1)) {
  149.       case 10:
  150.     HexDump("Hexdump of GfxBase reserved Long words",&GfxBase->reserved[0],
  151.         PTRSIZE, (long)PTRSIZE * 2);
  152.         break;
  153.       case 11:
  154.     HexDump("Hexdump of GfxBase hedley Long words",&GfxBase->hedley[0],
  155.         PTRSIZE, (long)PTRSIZE * 4);
  156.         break;
  157.       case 12:
  158.     HexDump("Hexdump of GfxBase hedley2 Long words",&GfxBase->hedley2[0],
  159.         PTRSIZE, (long)PTRSIZE * 4);
  160.         break;
  161.       case MOREGADG:
  162.     PrGfxBase4(" GfxBase (page 4)", GBase, sum);
  163.         break;
  164.     }
  165.   }
  166.   level--;
  167. }
  168. void PrGfxBase4(string, GBase, offset) char *string; struct GfxBase *GBase;
  169. int offset;
  170. {
  171. static struct StructData structdata[] = {
  172.      { " hedley3[3]",    "ULONG",           0, PTRSIZE * 4    },
  173.      { " hedley_spr[4]","ULONG",           0, PTRSIZE * 4    },
  174.      { " hedley_sp1[4]","ULONG",           0, PTRSIZE * 4    }
  175.   };
  176. int sum, choice = -1;
  177.   level++;
  178.   while (choice) {
  179.     sum = SetOptionText(string, structdata, (APTR)GBase, DATASIZE, offset);
  180.     switch (choice = GetChoice(DATASIZE)) {
  181.       case  1:
  182.     HexDump("Hexdump of GfxBase hedley3 Long words",&GfxBase->hedley3[0],
  183.         PTRSIZE, (long)PTRSIZE * 3);
  184.         break;
  185.       case  2:
  186.     HexDump("Hexdump of GfxBase hedley_sprites Long words",
  187.         &GfxBase->hedley_sprites[0], PTRSIZE, (long)PTRSIZE * 4);
  188.         break;
  189.       case  3:
  190.     HexDump("Hexdump of GfxBase hedley_sprites1 Long words",
  191.         &GfxBase->hedley_sprites1[0], PTRSIZE, (long)PTRSIZE * 4);
  192.         break;
  193.       case MOREGADG:
  194.         break;
  195.     }
  196.   }
  197.   level--;
  198. }
  199.